package com.vito.dcs.asphalt.asphaltGradation.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.factory.IDFactory;
import com.vito.base.model.DataGrid;
import com.vito.dcs.asphalt.asphaltGradation.dao.AsphaltGradationMapper;
import com.vito.dcs.asphalt.asphaltGradation.model.AsphaltGradationModel;
import com.vito.dcs.asphalt.asphaltGradation.service.AsphaltGradationService;

/**
 * 沥青站筛孔合成级配统计
 * @author lyhao
 *
 */
@Service
public class AsphaltGradationServiceImpl implements AsphaltGradationService {
	
	@Autowired
	private AsphaltGradationMapper asphaltGradationMapper;
	
	@Override
	public int save(AsphaltGradationModel asphaltGradationModel){
		return asphaltGradationMapper.save(asphaltGradationModel);
	}
	@Override
	public DataGrid<AsphaltGradationModel> queryAllByPage(AsphaltGradationModel asphaltGradationModel){
		DataGrid<AsphaltGradationModel> dg = new DataGrid<AsphaltGradationModel>();
		dg.setRows(asphaltGradationMapper.queryAllByPage(asphaltGradationModel));
		dg.setTotal(asphaltGradationModel.getTotal());
		return dg;
	}
	@Override
	public AsphaltGradationModel query(AsphaltGradationModel asphaltGradationModel){
		return asphaltGradationMapper.query(asphaltGradationModel);
	}
	@Override
	public Integer update(AsphaltGradationModel asphaltGradationModel){
		return asphaltGradationMapper.update(asphaltGradationModel);
	}
	
	@Override
	public Integer delete(AsphaltGradationModel asphaltGradationModel){
		return asphaltGradationMapper.delete(asphaltGradationModel);
	}

    @Override
	public int saveAsphaltGradation(AsphaltGradationModel asphaltGradationModel){
	    asphaltGradationModel.setId(IDFactory.getIDFactory().getIdInc()+"");                                                            
		return save(asphaltGradationModel);
	}
	@Override
	public List<Map<String, String>> queryChartData(Map<String, String> map) {
		return asphaltGradationMapper.queryChartData(map);
	}
}